module RolesHelper
  def get_records_sorted_and_paginated(column_to_sort,page,per_page,order)

   # raise "Role doesn't have " + column_to_sort + " method " if Role.respond_to?(column_to_sort) unless column_to_sort.nil?

    if column_to_sort.nil?
      Role.paginate(:per_page => per_page, :page => page).order("name ASC")
    else
      Role.paginate(:per_page => per_page, :page => page).order(column_to_sort + " " + order)
    end
  end

  def get_header_info
    header_info = Hash.new()
    header_info["id"] = I18n.t('object.role.id')
    header_info["name"] = I18n.t('object.role.name')
    return header_info
  end

  def create_entity
    return Role.new()
  end
end
